package io.persimmon.core.module.collection;

import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.atomic.AtomicInteger;

public class AtomicIntegerMap<T> extends ConcurrentHashMap<T, AtomicInteger> {
    public Integer incr(T key, int count) {
        AtomicInteger atomicInteger = new AtomicInteger(0);
        this.putIfAbsent(key, atomicInteger);
        return this.get(key).addAndGet(count);
    }
}
